//
//  DerbyNSOAddress.h
//  DerbyOSSampler
//
//  Created by glenn andreas on 1/7/14.
//  Copyright (c) 2014 glenn andreas. All rights reserved.
//

#import <Foundation/Foundation.h>
#include <sys/socket.h>

/* You'd think Cocoa would provide a class to manage all the various socket address family.  It doesn't, so
 we have a simple one with IPv4 and IPv6 support */

@interface DerbyNSOdeAddress : NSObject
- (id) initWithData: (NSData *) data;
- (id) initWithString: (NSString *) data; // "address:port"
- (id) initWithAddress: (struct sockaddr) addr;
- (id) initWithAddress: (struct sockaddr) addr port: (int) port;
@property (readonly) struct sockaddr address;
@property (readonly) struct sockaddr_in addressV4;
@property (readonly) struct sockaddr_in6 addressV6;
@property (readonly) int port;
@property (readonly) NSString *stringValue; //"address:port"
@end
